import request from '@/utils/request'

// 获取客户信息
export function getClients(params) {
  return request({
    url: '/clients',
    params
  })
}

// 删除
export function delClient(id) {
  return request({
    url: `/clients/${id}`,
    method: 'delete'
  })
}

// 获取经纪数量
export function getAgent() {
  return request({
    url: '/agents'
  })
}

// 获取数量
export function getClientCount(params) {
  return request({
    url: '/clients/count',
    params
  })
}

// 新增
export function addClient(data) {
  return request({
    url: '/clients',
    method: 'post',
    data
  })
}

// 回显
export function getClientById(id) {
  return request({
    url: `/clients/${id}`,
    method: 'get'
  })
}

// 编辑
export function editClient(data) {
  return request({
    url: `/clients/${data.id}`,
    method: 'put',
    data
  })
}

// 筛选
export function searchClient(params) {
  return request({
    url: '/Clients',
    params
  })
}
